import Vue from 'vue'
import vuex from 'vuex'

Vue.use(vuex);

export default new vuex.Store({
  strict: true,
  state: {
    isLogin: false, //是否登录
    isLoginAdmin: false, //是否登录-后台
    cfgData: {}, //网站配置信息
  },
  mutations: {
    setIsLogin(state, value) {
      state.isLogin = value;
    },
    setIsLoginAdmin(state, value) {
      state.isLoginAdmin = value;
    },
    setCfgData(state, value) {
      state.cfgData = value;
    },
  },
  actions: {
    setIsLogin({commit}, value) {
      commit('setIsLogin', value);
    },
    setIsLoginAdmin({commit}, value) {
      commit('setIsLoginAdmin', value);
    },
    setCfgData({commit}, value) {
      commit('setCfgData', value);
    },
  },
})
